import Vue from 'vue'
import Vuex from 'vuex'
import { getItem, setItem } from '@/utils/strage.js'

Vue.use(Vuex)
export default new Vuex.Store({
  state: {
    user: getItem('HMTT_TOKEN')

  },
  mutations: {
    // 把数据放在vuex里
    initUser (state, data) {
      state.user = data
      setItem('HMTT_TOKEN', data)
    }
  },
  actions: {
  },
  modules: {
  }
})
